export default (fn: Function, ms:number = 100) => {
  let timeout: any = null;
  return () => {
    clearTimeout(timeout);
    timeout = setTimeout(fn, ms);
  };
}
